Skip to content

feat(vnext): coordinate bounded catalog search work#195

Merged
Light2Dark merged 5 commits into
dev-refactorfrom
codex/vnext-catalog-search-work
Jul 25, 2026
Merged

feat(vnext): coordinate bounded catalog search work#195
Light2Dark merged 5 commits into
dev-refactorfrom
codex/vnext-catalog-search-work

Conversation

@Light2Dark

@Light2Dark Light2Dark commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary

  • add the package-private bounded catalog search-work coordinator
  • compose provider authentication, epoch authority, latest-wins ownership, cancellation, deadlines, and response publication
  • harden hostile and reentrant lifecycle boundaries, including exact disposal hooks and captured Promise intrinsics
  • document the scheduler contract and deferred cache/session/UI responsibilities in ADR 0005
  • add strict API fixtures, invariant-heavy unit coverage, and capacity/performance benchmarks

Invariants

  • at most 8 provider searches are active and 64 are queued
  • owners join only exact structural request keys and supersede independently
  • scope epoch changes retire same-scope work without crossing scope boundaries
  • failed captures, invalid input, cancellation, disposal, overload, and deadlines settle promptly and exactly once
  • provider calls, timers, clocks, thenables, callbacks, and response decoding may be hostile or reentrant without reviving retired work
  • the authenticated dialect runtime is the sole dialect identity authority

Validation

  • vitest: 1,856 passed, 1 expected failure
  • changed coverage: 97.29% statements, 96.23% branches, 99.46% functions, 97.73% lines
  • search coordinator: 97.03% statements, 95.09% branches, 100% functions, 97.84% lines
  • epoch coordinator: 98.31% statements, 97.42% branches, 98.21% functions, 98.89% lines
  • strict source, tests, vNext API fixture, loose-optional fixture, and demo typechecks
  • zero-warning oxlint
  • test-integrity gate
  • 4 browser files / 7 browser tests
  • exact-tarball package smoke test
  • worker placement and bundle budgets
  • production dependency audit: no known vulnerabilities
  • catalog search-work benchmark suite
  • two independent adversarial exact-head approvals

Part of #169.


Summary by cubic

Adds a package-private, bounded catalog search-work coordinator that composes provider auth with epoch authority to run searches safely, dedupe by exact keys, and enforce deadlines. Also centralizes catalog scope validation to a shared boundary utility. Progress toward #169.

  • New Features

    • Added createSqlCatalogSearchWorkCoordinator with 8 active and 64 queued limits, exact-key in-flight sharing, and latest-wins per owner.
    • Owners capture scope and dialect; the authenticated dialect runtime defines the provider ID and epoch authority.
    • Independent cancellation, queue and execution deadlines, and a small synchronous budget; outcomes include usable, superseded, cancelled, and unavailable.
    • Safe response decoding and epoch publication; first baseline re-keys unobserved work in the same scope.
    • Benchmarks and strict unit/type tests for lifecycle, concurrency, deadlines, and adversarial scenarios.
    • ADR 0005 updated to document scheduler/deadlines and package-owned disposal semantics.
  • Refactors

    • Epoch coordinator now accepts a package-owned disposal target, invokes it exactly once, and drains non-undefined returns with captured Promise intrinsics (resilient to a replaced global Promise).
    • Centralized scope validation into isValidSqlCatalogScope in the boundary; adopted by epoch and search-work paths with new tests.
    • Hardened lifecycle boundaries and cleanup; exact disposal and hostile thenable handling.
    • Dialect runtime exposes a stable id; tests assert coherence and deep-freeze properties.

Written for commit 061a3c6. Summary will update on new commits.

Review in cubic

@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 97.4% (🎯 91%) 1875 / 1925
🔵 Statements 97.05% (🎯 91%) 1941 / 2000
🔵 Functions 99.54% (🎯 90%) 217 / 218
🔵 Branches 96.11% (🎯 85%) 1508 / 1569
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/vnext/relation-catalog-boundary.ts 95.9% 95.79% 100% 95.84% 285-286, 294-295, 383, 421, 446, 457, 514, 571, 609, 713, 719, 753, 795
src/vnext/relation-catalog-epoch-coordinator.ts 98.25% 97.21% 98.18% 98.85% 241, 337, 393-394, 426, 540, 1001, 1045
src/vnext/relation-catalog-search-work.ts 97.12% 95.11% 100% 97.96% 478, 490-491, 839, 860, 919-920, 996, 1010, 1014, 1086, 1101, 1162-1171, 1347, 1640
src/vnext/relation-dialect.ts 96.72% 96.47% 100% 96.63% 144, 295, 323, 380, 386, 425, 632, 733, 747, 809, 822, 828, 836, 881, 1038, 1048, 1086, 1349
Generated in workflow #748 for commit 061a3c6 by the Vitest Coverage Report Action

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 9 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/vnext/relation-catalog-search-work.ts Outdated
@Light2Dark
Light2Dark merged commit d39d908 into dev-refactor Jul 25, 2026
9 checks passed
@Light2Dark
Light2Dark deleted the codex/vnext-catalog-search-work branch July 25, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant